Replace all uses of qAsConst with std::as_const
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 28 Nov 2024 08:55:12 +0000 (16:55 +0800)
committerMatthieu Gallien <matthieu.gallien@nextcloud.com>
Fri, 20 Dec 2024 15:26:57 +0000 (16:26 +0100)
Fixes deprecation warnings on Qt 6.8.0

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
20 files changed:
src/3rdparty/kmessagewidget/kmessagewidget.cpp
src/cmd/simplesslerrorhandler.cpp
src/gui/accountmanager.cpp
src/gui/application.cpp
src/gui/editlocallyjob.cpp
src/gui/filedetails/sharemodel.cpp
src/gui/folder.cpp
src/gui/folderman.cpp
src/gui/folderstatusmodel.cpp
src/gui/navigationpanehelper.cpp
src/gui/owncloudgui.cpp
src/gui/socketapi/socketapi.cpp
src/gui/syncconflictsmodel.cpp
src/gui/tray/unifiedsearchresultslistmodel.cpp
src/gui/tray/usermodel.cpp
src/libsync/discovery.cpp
src/libsync/owncloudpropagator.cpp
src/libsync/propagateuploadng.cpp
src/libsync/syncengine.cpp
src/libsync/syncfilestatustracker.cpp

index 70d5941391b5cfe642b454a035e393e458a21947..bbc8cf41f72d3da40e9b44d54114a6c922cc520c 100644 (file)
@@ -154,7 +154,7 @@ void KMessageWidgetPrivate::createLayout()
         layout->addWidget(iconLabel);
         layout->addWidget(textLabel);
 
-        for (QToolButton *button : qAsConst(buttons)) {
+        for (QToolButton *button : std::as_const(buttons)) {
             layout->addWidget(button);
         }
 
index f471403aa4145e391861bb79e4ee7187714e8045..50d55978eeac4aea8388b43f60b9395cec561b52 100644 (file)
@@ -27,7 +27,7 @@ bool SimpleSslErrorHandler::handleErrors(QList<QSslError> errors, const QSslConf
     }
 
     if (account->trustCertificates()) {
-        for (const auto &error : qAsConst(errors)) {
+        for (const auto &error : std::as_const(errors)) {
             certs->append(error.certificate());
         }
         return true;
@@ -35,7 +35,7 @@ bool SimpleSslErrorHandler::handleErrors(QList<QSslError> errors, const QSslConf
 
     bool allTrusted = true;
 
-    for (const auto &error : qAsConst(errors)) {
+    for (const auto &error : std::as_const(errors)) {
         if (!account->approvedCerts().contains(error.certificate())) {
             allTrusted = false;
         }
index a661f3eb3f253ba1015c05a909a41d9e4442193a..ccfcfec4cbd0f1b243c8d0429f4783b8da265a94 100644 (file)
@@ -306,7 +306,7 @@ void AccountManager::save(bool saveCredentials)
 {
     const auto settings = ConfigFile::settingsWithGroup(QLatin1String(accountsC));
     settings->setValue(QLatin1String(versionC), maxAccountsVersion);
-    for (const auto &acc : qAsConst(_accounts)) {
+    for (const auto &acc : std::as_const(_accounts)) {
         settings->beginGroup(acc->account()->id());
         saveAccountHelper(acc->account().data(), *settings, saveCredentials);
         settings->endGroup();
index 1bf8cffea81ef06d51110fcf77fedf90d765b8fd..dcac6ad3234fc4a6857f7198ca9fe96a257f7372 100644 (file)
@@ -199,7 +199,7 @@ bool Application::configVersionMigration()
         settings->endGroup();
 
         // Wipe confusing keys from the future, ignore the others
-        for (const auto &badKey : qAsConst(deleteKeys)) {
+        for (const auto &badKey : std::as_const(deleteKeys)) {
             settings->remove(badKey);
         }
     }
index 07a1d8f2afb7cc4685d4f83740869ccd3e3f4369..cac6de6d12ec2190d63b9b0fb4dc09d9617215a6 100644 (file)
@@ -514,7 +514,7 @@ void EditLocallyJob::lockFile(const QString &etag)
 
 void EditLocallyJob::disconnectFolderSignals()
 {
-    for (const auto &connection : qAsConst(_folderConnections)) {
+    for (const auto &connection : std::as_const(_folderConnections)) {
         disconnect(connection);
     }
 }
index a199231998ad7dd290e826311ea65901648740fb..73441a0627b296f184349cbec2ef12cf39d56b95 100644 (file)
@@ -385,7 +385,7 @@ void ShareModel::handlePlaceholderLinkShare()
     auto linkSharePresent = false;
     auto placeholderLinkSharePresent = false;
 
-    for (const auto &share : qAsConst(_shares)) {
+    for (const auto &share : std::as_const(_shares)) {
         const auto shareType = share->getShareType();
 
         if (!linkSharePresent && shareType == Share::TypeLink) {
@@ -415,7 +415,7 @@ void ShareModel::handleSecureFileDropLinkShare()
     auto linkSharePresent = false;
     auto secureFileDropLinkSharePresent = false;
 
-    for (const auto &share : qAsConst(_shares)) {
+    for (const auto &share : std::as_const(_shares)) {
         const auto shareType = share->getShareType();
 
         if (!linkSharePresent && shareType == Share::TypeLink) {
index 6b7f2ad45fc34f74e12c36bccc0df426ac3a76d9..fffbb11e5eaec9c186c45cdec7dc57382f00c078 100644 (file)
@@ -1760,7 +1760,7 @@ void Folder::removeLocalE2eFiles()
     const auto existingBlacklistSet = QSet<QString>{existingBlacklist.begin(), existingBlacklist.end()};
     auto expandedBlacklistSet = QSet<QString>{existingBlacklist.begin(), existingBlacklist.end()};
 
-    for (const auto &path : qAsConst(e2eFoldersToBlacklist)) {
+    for (const auto &path : std::as_const(e2eFoldersToBlacklist)) {
         expandedBlacklistSet.insert(path);
     }
 
index d3f6cd3637d7004c7118319930670db24b41af77..bf7e606dea40f27b147fc2d6bd468694daa5adfc 100644 (file)
@@ -226,7 +226,7 @@ int FolderMan::setupFolders()
 
     emit folderListChanged(_folderMap);
 
-    for (const auto folder : qAsConst(_folderMap)) {
+    for (const auto folder : std::as_const(_folderMap)) {
         folder->processSwitchedToVirtualFiles();
     }
 
@@ -768,7 +768,7 @@ void FolderMan::slotRunOneEtagJob()
 {
     if (_currentEtagJob.isNull()) {
         Folder *folder = nullptr;
-        for (Folder *f : qAsConst(_folderMap)) {
+        for (Folder *f : std::as_const(_folderMap)) {
             if (f->etagJob()) {
                 // Caveat: always grabs the first folder with a job, but we think this is Ok for now and avoids us having a separate queue.
                 _currentEtagJob = f->etagJob();
@@ -898,7 +898,7 @@ void FolderMan::startScheduledSyncSoon()
 void FolderMan::slotStartScheduledFolderSync()
 {
     if (isAnySyncRunning()) {
-        for (auto f : qAsConst(_folderMap)) {
+        for (auto f : std::as_const(_folderMap)) {
             if (f->isSyncRunning())
                 qCInfo(lcFolderMan) << "Currently folder " << f->remoteUrl().toString() << " is running, wait for finish!";
         }
@@ -1028,12 +1028,12 @@ void FolderMan::runEtagJobIfPossible(Folder *folder)
 void FolderMan::slotAccountRemoved(AccountState *accountState)
 {
     QVector<Folder *> foldersToRemove;
-    for (const auto &folder : qAsConst(_folderMap)) {
+    for (const auto &folder : std::as_const(_folderMap)) {
         if (folder->accountState() == accountState) {
             foldersToRemove.push_back(folder);
         }
     }
-    for (const auto &folder : qAsConst(foldersToRemove)) {
+    for (const auto &folder : std::as_const(foldersToRemove)) {
         removeFolder(folder);
     }
 }
@@ -1050,7 +1050,7 @@ void FolderMan::slotRemoveFoldersForAccount(AccountState *accountState)
         }
     }
 
-    for (const auto &f : qAsConst(foldersToRemove)) {
+    for (const auto &f : std::as_const(foldersToRemove)) {
         removeFolder(f);
     }
     emit folderListChanged(_folderMap);
@@ -1070,7 +1070,7 @@ void FolderMan::slotServerVersionChanged(Account *account)
         qCWarning(lcFolderMan) << "The server version is unsupported:" << account->serverVersion()
                                << "pausing all folders on the account";
 
-        for (auto &f : qAsConst(_folderMap)) {
+        for (auto &f : std::as_const(_folderMap)) {
             if (f->accountState()->account().data() == account) {
                 f->setSyncPaused(true);
             }
@@ -1088,7 +1088,7 @@ void FolderMan::slotWatchedFileUnlocked(const QString &path)
 
 void FolderMan::slotScheduleFolderByTime()
 {
-    for (const auto &f : qAsConst(_folderMap)) {
+    for (const auto &f : std::as_const(_folderMap)) {
         // Never schedule if syncing is disabled or when we're currently
         // querying the server for etags
         if (!f->canSync() || f->etagJob()) {
@@ -1462,7 +1462,7 @@ void FolderMan::slotWipeFolderForAccount(AccountState *accountState)
     }
 
     bool success = false;
-    for (const auto &f : qAsConst(foldersToRemove)) {
+    for (const auto &f : std::as_const(foldersToRemove)) {
         if (!f) {
             qCCritical(lcFolderMan) << "Can not remove null folder";
             return;
@@ -1665,7 +1665,7 @@ void FolderMan::trayOverallStatus(const QList<Folder *> &folders,
         auto runSeen = false;
         auto various = false;
 
-        for (const Folder *folder : qAsConst(folders)) {
+        for (const Folder *folder : std::as_const(folders)) {
             // We've already seen an error, worst case met.
             // No need to check the remaining folders.
             if (errorsSeen) {
@@ -1967,7 +1967,7 @@ void FolderMan::setIgnoreHiddenFiles(bool ignore)
 {
     // Note that the setting will revert to 'true' if all folders
     // are deleted...
-    for (Folder *folder : qAsConst(_folderMap)) {
+    for (Folder *folder : std::as_const(_folderMap)) {
         folder->setIgnoreHiddenFiles(ignore);
         folder->saveToSettings();
     }
@@ -2015,7 +2015,7 @@ void FolderMan::slotProcessFilesPushNotification(Account *account)
 {
     qCInfo(lcFolderMan) << "Got files push notification for account" << account;
 
-    for (auto folder : qAsConst(_folderMap)) {
+    for (auto folder : std::as_const(_folderMap)) {
         // Just run on the folders that belong to this account
         if (folder->accountState()->account() != account) {
             continue;
index 44b2402c43c4f3aaab693a01b06ce7d1f97e0b79..91808fc48c1229541b340430fb3f4eed427f7044 100644 (file)
@@ -833,7 +833,7 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
         endInsertRows();
     }
 
-    for (const auto undecidedIndex : qAsConst(undecidedIndexes)) {
+    for (const auto undecidedIndex : std::as_const(undecidedIndexes)) {
         emit suggestExpand(index(undecidedIndex, 0, parentIdx));
     }
     /* Try to remove from the undecided lists the items that are not on the server. */
@@ -916,7 +916,7 @@ void FolderStatusModel::slotUpdateFolderState(Folder *folder)
 
 void FolderStatusModel::slotApplySelectiveSync()
 {
-    for (const auto &folderInfo : qAsConst(_folders)) {
+    for (const auto &folderInfo : std::as_const(_folders)) {
         if (!folderInfo._fetched) {
             folderInfo._folder->journalDb()->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, QStringList());
             continue;
index cf792084acd2bb8893f568647c2aa499c11a7a14..027d0ddeaa796190ad626298776f257c775f453e 100644 (file)
@@ -48,7 +48,7 @@ void NavigationPaneHelper::setShowInExplorerNavigationPane(bool show)
     _showInExplorerNavigationPane = show;
     // Re-generate a new CLSID when enabling, possibly throwing away the old one.
     // updateCloudStorageRegistry will take care of removing any unknown CLSID our application owns from the registry.
-    for (const auto &folder : qAsConst(_folderMan->map())) {
+    for (const auto &folder : std::as_const(_folderMan->map())) {
         folder->setNavigationPaneClsid(show ? QUuid::createUuid() : QUuid());
     }
 
@@ -89,7 +89,7 @@ void NavigationPaneHelper::updateCloudStorageRegistry()
         // Then re-save every folder that has a valid navigationPaneClsid to the registry.
         // We currently don't distinguish between new and existing CLSIDs, if it's there we just
         // save over it. We at least need to update the tile in case we are suddently using multiple accounts.
-        for (const auto &folder : qAsConst(_folderMan->map())) {
+        for (const auto &folder : std::as_const(_folderMan->map())) {
             if (!folder->navigationPaneClsid().isNull()) {
                 // If it already exists, unmark it for removal, this is a valid sync root.
                 entriesToRemove.removeOne(folder->navigationPaneClsid());
@@ -161,7 +161,7 @@ void NavigationPaneHelper::updateCloudStorageRegistry()
     }
 
     // Then remove anything that isn't in our folder list anymore.
-    for (const auto &clsid : qAsConst(entriesToRemove)) {
+    for (const auto &clsid : std::as_const(entriesToRemove)) {
         const auto clsidStr = clsid.toString();
         const QString clsidPath = QString() % R"(Software\Classes\CLSID\)" % clsidStr;
         const QString clsidPathWow64 = QString() % R"(Software\Classes\Wow6432Node\CLSID\)" % clsidStr;
index dccdcc3a8c7f9eacf4e17796b01e91c0206b4bf3..7323a8d5b4a8a4be9c94c43a209679b18215b2f3 100644 (file)
@@ -361,7 +361,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
 #else
         QStringList messages;
         messages.append(tr("Disconnected from accounts:"));
-        for (const auto &accountState : qAsConst(problemAccounts)) {
+        for (const auto &accountState : std::as_const(problemAccounts)) {
             QString message = tr("Account %1: %2").arg(accountState->account()->displayName(), accountState->stateString(accountState->state()));
             if (!accountState->connectionErrors().empty()) {
                 message += QLatin1String("\n");
index 071ae448b381454b41d8007794dc6d4414549860..cf47d3f5bcd5ececef611e72c8d3655ffdb66f56 100644 (file)
@@ -472,7 +472,7 @@ void SocketApi::slotRegisterPath(const QString &alias)
     Folder *f = FolderMan::instance()->folder(alias);
     if (f) {
         const QString message = buildRegisterPathMessage(removeTrailingSlash(f->path()));
-        for (const auto &listener : qAsConst(_listeners)) {
+        for (const auto &listener : std::as_const(_listeners)) {
             qCInfo(lcSocketApi) << "Trying to send SocketAPI Register Path Message -->" << message << "to" << listener->socket;
             listener->sendMessage(message);
         }
@@ -519,7 +519,7 @@ void SocketApi::slotUpdateFolderView(Folder *f)
 
 void SocketApi::broadcastMessage(const QString &msg, bool doWait)
 {
-    for (const auto &listener : qAsConst(_listeners)) {
+    for (const auto &listener : std::as_const(_listeners)) {
         listener->sendMessage(msg, doWait);
     }
 }
@@ -639,7 +639,7 @@ void SocketApi::broadcastStatusPushMessage(const QString &systemPath, SyncFileSt
     QString msg = buildMessage(QLatin1String("STATUS"), systemPath, fileStatus.toSocketAPIString());
     Q_ASSERT(!systemPath.endsWith('/'));
     uint directoryHash = qHash(systemPath.left(systemPath.lastIndexOf('/')));
-    for (const auto &listener : qAsConst(_listeners)) {
+    for (const auto &listener : std::as_const(_listeners)) {
         listener->sendMessageIfDirectoryMonitored(msg, directoryHash);
     }
 }
index 2ddbf0225786dcd43fffa97c032bef4fd45fa44c..d6a7e702bcad38ae008f0f97f2f9b5dceede6efe 100644 (file)
@@ -224,7 +224,7 @@ void SyncConflictsModel::selectAllConflicting(bool selected)
 
 void SyncConflictsModel::applySolution()
 {
-    for(const auto &syncConflict : qAsConst(_conflictData)) {
+    for(const auto &syncConflict : std::as_const(_conflictData)) {
         if (syncConflict.isValid()) {
             qCInfo(lcSyncConflictsModel) << syncConflict.mExistingFilePath << syncConflict.mConflictingFilePath << syncConflict.solution();
             ConflictSolver solver;
@@ -240,7 +240,7 @@ void SyncConflictsModel::updateConflictsData()
     _conflictData.clear();
     _conflictData.reserve(_data.size());
 
-    for (const auto &oneConflict : qAsConst(_data)) {
+    for (const auto &oneConflict : std::as_const(_data)) {
         const auto folder = FolderMan::instance()->folder(oneConflict._folder);
         if (!folder) {
             qCWarning(lcSyncConflictsModel) << "no Folder instance for" << oneConflict._folder;
index 6ec9a7a2a6382d5f13b8936345129f6cd7b63b1a..2f461683cb76bd6cb3628b9707a80aae681f42b3 100644 (file)
@@ -503,7 +503,7 @@ void UnifiedSearchResultsListModel::startSearch()
         endResetModel();
     }
 
-    for (const auto &provider : qAsConst(_providers)) {
+    for (const auto &provider : std::as_const(_providers)) {
         startSearchForProvider(provider._id);
     }
 }
@@ -725,7 +725,7 @@ void UnifiedSearchResultsListModel::removeFetchMoreTrigger(const QString &provid
 
 void UnifiedSearchResultsListModel::disconnectAndClearSearchJobs()
 {
-    for (const auto &connection : qAsConst(_searchJobConnections)) {
+    for (const auto &connection : std::as_const(_searchJobConnections)) {
         if (connection) {
             QObject::disconnect(connection);
         }
index 30b3d699f81eef528178f519ca1351ae07d45625..abddeaa102d651ddb542930c50d3bc890bd6b548 100644 (file)
@@ -236,7 +236,7 @@ void User::slotBuildNotificationDisplay(const ActivityList &list)
         return;
     }
 
-    for (const auto &activity : qAsConst(toNotifyList)) {
+    for (const auto &activity : std::as_const(toNotifyList)) {
         if (activity._objectType == QStringLiteral("chat")) {
             showDesktopTalkNotification(activity);
         } else {
@@ -1308,7 +1308,7 @@ QString UserModel::currentUserServer()
 void UserModel::addUser(AccountStatePtr &user, const bool &isCurrent)
 {
     bool containsUser = false;
-    for (const auto &u : qAsConst(_users)) {
+    for (const auto &u : std::as_const(_users)) {
         if (u->account() == user->account()) {
             containsUser = true;
             continue;
@@ -1424,7 +1424,7 @@ void UserModel::setCurrentUserId(const int id)
 
     const auto isCurrentUserChanged = !_users[id]->isCurrentUser();
     if (isCurrentUserChanged) {
-        for (const auto user : qAsConst(_users)) {
+        for (const auto user : std::as_const(_users)) {
             user->setCurrentUser(false);
         }
         _users[id]->setCurrentUser(true);
index e842f825408087b5b6c3205b7e3150033f68c636..4d8f57dfbf3a3c05e748727745ac021949842f19 100644 (file)
@@ -1858,7 +1858,7 @@ bool ProcessDirectoryJob::checkPermissions(const OCC::SyncFileItemPtr &item)
 
 bool ProcessDirectoryJob::isAnyParentBeingRestored(const QString &file) const
 {
-    for (const auto &directoryNameToRestore : qAsConst(_discoveryData->_directoryNamesToRestoreOnPropagation)) {
+    for (const auto &directoryNameToRestore : std::as_const(_discoveryData->_directoryNamesToRestoreOnPropagation)) {
         if (file.startsWith(QString(directoryNameToRestore + QLatin1Char('/')))) {
             qCWarning(lcDisco) << "File" << file << " is within the tree that's being restored" << directoryNameToRestore;
             return true;
index fc166ecce8e9060b96e2381966d9898ec1613f4a..5e4c5fa2500577a9ede710bfc4731b57a684513d 100644 (file)
@@ -1236,7 +1236,7 @@ bool PropagatorCompositeJob::scheduleSelfOrChild()
     }
 
     // Ask all the running composite jobs if they have something new to schedule.
-    for (auto runningJob : qAsConst(_runningJobs)) {
+    for (auto runningJob : std::as_const(_runningJobs)) {
         ASSERT(runningJob->_state == Running);
 
         if (possiblyRunNextJob(runningJob)) {
index 32e1192f3fa2f0845ff6648ddd080970afa02734..e193e9561178df2918e22b6ce269d83208f6c107 100644 (file)
@@ -185,7 +185,7 @@ void PropagateUploadFileNG::slotPropfindFinished()
         // Make sure that if there is a "hole" and then a few more chunks, on the server
         // we should remove the later chunks. Otherwise when we do dynamic chunk sizing, we may end up
         // with corruptions if there are too many chunks, or if we abort and there are still stale chunks.
-        for (const auto &serverChunk : qAsConst(_serverChunks)) {
+        for (const auto &serverChunk : std::as_const(_serverChunks)) {
             auto job = new DeleteJob(propagator()->account(), Utility::concatUrlPath(chunkUploadFolderUrl(), serverChunk.originalName), this);
             QObject::connect(job, &DeleteJob::finishedSignal, this, &PropagateUploadFileNG::slotDeleteJobFinished);
             _jobs.append(job);
index c64b9219ca3cd15ad4d08a910c0438bf6037d04f..8d4915b488ead68ea43792ab06fd6bcd8bcc0f39 100644 (file)
@@ -292,7 +292,7 @@ void SyncEngine::conflictRecordMaintenance()
     //
     // This happens when the conflicts table is new or when conflict files
     // are downloaded but the server doesn't send conflict headers.
-    for (const auto &path : qAsConst(_seenConflictFiles)) {
+    for (const auto &path : std::as_const(_seenConflictFiles)) {
         ASSERT(Utility::isConflictFile(path));
 
         auto bapath = path.toUtf8();
@@ -964,7 +964,7 @@ void SyncEngine::restoreOldFiles(SyncFileItemVector &syncItems)
        upload the client file. But we still downloaded the old file in a conflict file just in case
     */
 
-    for (const auto &syncItem : qAsConst(syncItems)) {
+    for (const auto &syncItem : std::as_const(syncItems)) {
         if (syncItem->_direction != SyncFileItem::Down || syncItem->_isSelectiveSync) {
             continue;
         }
@@ -1023,7 +1023,7 @@ void SyncEngine::finishSync()
     }
 
     if (_discoveryPhase && _discoveryPhase->_hasDownloadRemovedItems && _discoveryPhase->_hasUploadErrorItems) {
-        for (const auto &item : qAsConst(_syncItems)) {
+        for (const auto &item : std::as_const(_syncItems)) {
             if (item->_instruction == CSYNC_INSTRUCTION_ERROR && item->_direction == SyncFileItem::Up) {
                 // item->_instruction = CSYNC_INSTRUCTION_IGNORE;
             }
@@ -1103,7 +1103,7 @@ bool SyncEngine::handleMassDeletion()
     const auto allFilesDeleted = !_hasNoneFiles && _hasRemoveFile;
 
     auto deletionCounter = 0;
-    for (const auto &oneItem : qAsConst(_syncItems)) {
+    for (const auto &oneItem : std::as_const(_syncItems)) {
         if (oneItem->_instruction == CSYNC_INSTRUCTION_REMOVE) {
             if (oneItem->isDirectory()) {
                 const auto result = _journal->listFilesInPath(oneItem->_file.toUtf8(), [&deletionCounter] (const auto &oneRecord) {
@@ -1124,7 +1124,7 @@ bool SyncEngine::handleMassDeletion()
     if ((allFilesDeleted || filesDeletedThresholdExceeded) && displayDialog) {
         qCWarning(lcEngine) << "Many files are going to be deleted, asking the user";
         int side = 0; // > 0 means more deleted on the server.  < 0 means more deleted on the client
-        for (const auto &it : qAsConst(_syncItems)) {
+        for (const auto &it : std::as_const(_syncItems)) {
             if (it->_instruction == CSYNC_INSTRUCTION_REMOVE) {
                 side += it->_direction == SyncFileItem::Down ? 1 : -1;
             }
@@ -1455,7 +1455,7 @@ void SyncEngine::slotScheduleFilesDelayedSync()
         newTimer->callOnTimeout(this, [this, newTimer] {
             qCInfo(lcEngine) << "Rescanning now that delayed sync run is scheduled for:" << newTimer->files;
 
-            for (const auto &file : qAsConst(newTimer->files)) {
+            for (const auto &file : std::as_const(newTimer->files)) {
                 this->_filesScheduledForLaterSync.remove(file);
             }
 
@@ -1586,7 +1586,7 @@ void SyncEngine::slotUnscheduleFilesDelayedSync()
         return;
     }
 
-    for (const auto &file : qAsConst(_discoveryPhase->_filesUnscheduleSync)) {
+    for (const auto &file : std::as_const(_discoveryPhase->_filesUnscheduleSync)) {
         const auto fileSyncRunTimer = _filesScheduledForLaterSync.value(file);
 
         if (fileSyncRunTimer) {
index 2b934806fa08cd18901745aa8b6f2cc0aa19cea0..6e4e809629b4fc90c27e039570536e81ad96210b 100644 (file)
@@ -268,7 +268,7 @@ void SyncFileStatusTracker::slotAboutToPropagate(SyncFileItemVector &items)
     // Swap into a copy since fileStatus() reads _dirtyPaths to determine the status
     QSet<QString> oldDirtyPaths;
     std::swap(_dirtyPaths, oldDirtyPaths);
-    for (const auto &oldDirtyPath : qAsConst(oldDirtyPaths))
+    for (const auto &oldDirtyPath : std::as_const(oldDirtyPaths))
         emit fileStatusChanged(getSystemDestination(oldDirtyPath), fileStatus(oldDirtyPath));
 
     // Make sure to push any status that might have been resolved indirectly since the last sync